import { put, select } from 'redux-saga/effects'
//import GithubActions from '../Redux/GithubRedux'
//import UserActions from '../Redux/UserRedux'
import { is } from 'ramda'

// exported to make available for tests
// export const selectAvatar = (state) => state.github.avatar
import CityActions from '../Redux/CityRedux'

// process STARTUP actions
export function * startup (action) {
  if (__DEV__ && console.tron) {

    // logging an object for better clarity
    //console.tron.log({
    //  message: 'pass objects for better logging',
    //  //someGeneratorFunction: selectAvatar
    //})

    // fully customized!
    //const subObject = { a: 1, b: [1, 2, 3], c: true }
    //subObject.circularDependency = subObject // osnap!
    //console.tron.display({
    //  name: '🔥 IGNITE 🔥',
    //  preview: 'You should totally expand this',
    //  value: {
    //    '💃': 'Welcome to the future!',
    //    subObject,
    //    someInlineFunction: () => true,
    //    someGeneratorFunction: startup,
    //    someNormalFunction: selectAvatar
    //  }
    //})
  }
  //const avatar = yield select(selectAvatar)
  // only get if we don't have it yet
  //if (!is(String, avatar)) {
  //  yield put(GithubActions.userRequest('GantMan'))
  //}
  //yield put(CommodityActions.categoryRequest())
  //yield put(UserActions.logout())
  yield put(CityActions.cityRequest())
}
